package com.feng.controller.back;

import com.feng.dto.OnlineDto;
import com.feng.service.OnlineService;
import com.feng.vo.PageVo;
import com.feng.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: 丰
 * @date: 2023/1/1 16:09
 */
@RestController
@RequestMapping("/back/online")
@Api(tags = "后台反馈接口")
public class OnlineController {

    @Autowired
    private OnlineService onlineService;

    @ApiOperation("查询所有")
    @GetMapping("/getList")
    public ResultVo<List<OnlineDto>> getList(PageVo pageVo){
        return onlineService.selectAll(pageVo);
    }

    @ApiOperation("根据id删除")
    @DeleteMapping("/deleteById/{id}")
    public ResultVo<Integer> deleteById(@PathVariable("id") Integer id){
        return onlineService.deleteById(id);
    }
}
